import request from '@/utils/request';

export function listData(params) {
  return request({
    url: `/bland-box`,
    method: 'get',
    params
  })
}

export function postGift(form) {
  return request({
    url: `/gift/list`,
    method: 'post',
    data: form
  });
}

export function postAddData(form) {
  return request({
    url: `/bland-box`,
    method: 'post',
    data: form
  });
}

export function putEditData(id, form) {
  return request({
    url: `/bland-box/${id}`,
    method: 'put',
    data: form
  });
}

export function deleteData(form) {
  return request({
    url: `/bland-box`,
    method: 'delete',
    data: form
  });
}

/*
* 盲盒管理-盲盒-批量修改 - 批量修改
*   action	Int	1：本期；2：下期
*   info	string	id,礼物id,礼物数量;id,礼物id,礼物数量
* */
export function editMore(action, info) {
  return request({
    url: "/bland-box/editMore",
    method: "put",
    params: {action, info}
  })
}

/*
*
* 置换新奖池
*   type 类型
* */
export function replacePool(type) {
  return request({
    url: "/bland-box/replacePool",
    method: "put",
    params: {type}
  })
}
